package com.winning.pmph.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.google.gson.annotations.SerializedName;
import lombok.Data;

import javax.persistence.Table;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import java.util.List;

@Table(name = "book_catalog_item")
@XmlRootElement(name = "item")
@XmlAccessorType(XmlAccessType.FIELD)
@Data
public class BookCatalogItem {
    private static final long serialVersionUID = 1L;

    public static final String SITUATION_FRONT = "FRONT";
    public static final String SITUATION_BODY = "BODY";
    public static final String SITUATION_BACK = "BACK";

    @TableId
    private String id;

    @SerializedName("book_id")
    private String bookId;

    @SerializedName("book_article_id")
    private String bookArticleId;

    @SerializedName("sequence_number")
    private String sequenceNumber;

    private String bookArticleSequenceNumber;

    @XmlElement(name = "layer")
    private Integer layer;

    @XmlElement(name = "str")
    private String str;

    @SerializedName("parent_id")
    private String parentId;

    private String situation;

    @TableField(exist = false)
    private BookCatalogItemContent bookCatalogItemContent;
    @TableField(exist = false)
    private List<BookCatalogItem> children;
    @TableField(exist = false)
    private boolean filtered;

    /**
     * 同步时使用
     */
    @TableField(exist = false)
    private Integer version;
}
